(function ($) {
$(document).on('click','.allow',function(){
        var ID = document.getElementById("56").value;
//            alert("updateUser");
//     alert(ID+"a");

        $.ajax({
            url: getRootPath_web()+"/video/allowPublish",
            data: "ID=" + ID,
            type: "Post",
            dataType:"json",
            success: function (result) {
                if (result.success) {

                    alert("视频已发布");

                }
                else {
                    alert("出现错误");
                }
            }
        });
    });
    $(document).on('click','.updateUserBtn',function(){
        var ID = document.getElementsByName("a").item(0).id;

        document.getElementById("56").value=ID;

    });
    $(document).on('click','.deleteVideoBtn',function(){
        var ID = document.getElementsByName("b").item(0).id;
        document.getElementById("58").value=ID;

    });
    $(document).on('click','.deleteVideo',function(){

        var video_id = document.getElementById("58").value;

        $.ajax({
            url: getRootPath_web()+"/video/delete_video",
            data:"video_id="+video_id,
            type: "Get",
            dataType:"json",
            success: function (result) {
                if (result.success) {

                    alert("视频已删除");

                }
                else {
                    alert("出现错误");
                }
            }
        });
    });
    $(document).on('click','.deleteAbuseVideo',function(){

        var abuse_id = document.getElementById("58").value;

        $.ajax({
            url: getRootPath_web()+"/video/delete_abuse_video",
            data:"abuse_id="+abuse_id,
            type: "Get",
            dataType:"json",
            success: function (result) {
                if (result.success) {

                    alert("视频已删除");

                }
                else {
                    alert("出现错误");
                }
            }
        });
    });
    $(document).on('click','.invalidBtn',function(){
        var ID = document.getElementsByName("a").item(0).id;
//            alert("updateUser");
        document.getElementById("57").value=ID;

    });
    $(document).on('click','.playVideo',function(){
        var ID = $(this).attr("id");
        //            alert("updateUser");
        document.getElementById("10").src=ID;

    });
    $(document).on('click','.invalid',function(){
        var ID = document.getElementById("57").value;
//            alert("updateUser");
//     alert(ID+"a");

        $.ajax({
            url: getRootPath_web()+"/video/invalid",
            data: "ID=" + ID,
            type: "Post",
            dataType:"json",
            success: function (result) {
                if (result.success) {

                    alert("操作成功");

                }
                else {
                    alert("出现错误");
                }
            }
        });
    });
    function timestampToTime(timestamp) {
        var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
        var Y = date.getFullYear() + '/';
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '/';
        var D = date.getDate() + ' ';
        var h = date.getHours() + ':';
        var m = date.getMinutes() + ':';
        s = date.getSeconds();
        return Y+M+D;
    }
})(jQuery);